<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">


    <table class="table table-striped table-adminlog">
        <thead>
        <tr>
            <th width="100" style="color:red">{:__('会员等级信息')}</th>
            <!--<th>{:__('Content')}</th>-->
        </tr>
        </thead>
        <tbody>

        <tr>
            <td>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('等级级别')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-level" class="form-control" readonly="readonly" type="text" value="{$row.level|htmlentities}">
                    </div>
                </div>
            </td>
        </tr>

        <tr>
            <td>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><span style="color: red;font-size: 15px">*</span>{:__('等级名称')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-level_name" class="form-control" data-rule="required" name="row[level_name]" type="text" value="{$row.level_name|htmlentities}">
                    </div>
                </div>
            </td>
        </tr>

        <tr>
            <td>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><span style="color: red;font-size: 15px">*</span>{:__('会员费')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-price" class="form-control" data-rule="required" name="row[price]" type="text" value="{$row.price|htmlentities}">
                    </div>
                </div>
            </td>
        </tr>

        <tr>
            <td>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><span style="color: red;font-size: 15px">*</span>{:__('续费')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-renew" class="form-control" data-rule="required" name="row[renew]" type="text" value="{$row.renew|htmlentities}">
                    </div>
                </div>
            </td>
        </tr>

        <!--<tr>-->
            <!--<td>-->
                <!--<div class="form-group">-->
                    <!--<label class="control-label col-xs-12 col-sm-2">{:__('会员升级费')}:</label>-->
                    <!--<div class="col-xs-12 col-sm-8">-->
                        <!--<input id="c-upgrade" class="form-control" name="row[upgrade]" type="text" value="{$row.upgrade|htmlentities}">-->
                    <!--</div>-->
                <!--</div>-->
            <!--</td>-->
        <!--</tr>-->

        <tr id="upward">
            <td>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('增加成员费用')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-upward" class="form-control" name="row[upward]" type="text" value="{$row.upward|htmlentities}">
                    </div>
                </div>
            </td>
        </tr>

        </tbody>
    </table>


    <table id="table" class="table table-striped table-adminlog">
        <thead>
        <tr>
            <th width="100" style="color:red">{:__('会员权益')}</th>
            <!--<th>{:__('Content')}</th>-->
        </tr>
        </thead>
        <tbody>

        {foreach $categorys as $index=>$vo}
        <tr>
            <td>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{$vo.name}:</label>
                    <input id="c-serve_id" class="form-control" name="row[serve_id][]" type="hidden" value="{$vo.id}">
                    {if condition="in_array($vo.id,$arr)"}
                    <div class="col-xs-12 col-sm-8">
                        <!--<input type="radio" name="row[status][{$vo.id}]" value="0" checked>免费-->

                        <input type="radio" name="row[status][{$vo.id}]" value="0" {if condition="$arrs[$vo.id] == 0"}checked{/if}>免费
                        <input type="radio" name="row[status][{$vo.id}]" value="1" {if condition="$arrs[$vo.id] == 1"}checked{/if}>免1次
                        <input type="radio" name="row[status][{$vo.id}]" value="2" {if condition="$arrs[$vo.id] == 2"}checked{/if}>免1次/年
                        <input type="radio" name="row[status][{$vo.id}]" value="3" {if condition="$arrs[$vo.id] == 3"}checked{/if}>免2次/年
                        <input type="radio" name="row[status][{$vo.id}]" value="4" {if condition="$arrs[$vo.id] == 4"}checked{/if}>免3次/年
                    </div>
                    {else/}
                    <div class="col-xs-12 col-sm-8">
                        <!--<input type="radio" name="row[status][{$vo.id}]" value="0" checked>免费-->
                        <input type="radio" name="row[status][{$vo.id}]" value="0">免费
                        <input type="radio" name="row[status][{$vo.id}]" value="1">免1次
                        <input type="radio" name="row[status][{$vo.id}]" value="2">免1次/年
                        <input type="radio" name="row[status][{$vo.id}]" value="3">免2次/年
                        <input type="radio" name="row[status][{$vo.id}]" value="4">免3次/年
                    </div>
                    {/if}
                </div>
            </td>
        </tr>
        {/foreach}

        </tbody>
    </table>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script src="/assets/img/jquery-3.4.1.min.js"></script>
<script>
    id = {$row.id};

    //console.log(id);

    if (id == 3){
        $('#upward').show();
    } else {
        $('#upward').hide();
    }

    if (id == 1){
        $('#table').hide();
    } else {
        $('#table').show();
    }


</script>
